/* Prolog version of hanoi benchmark */

main :- han(20,1,2,3).

han(N,_,_,_) :- N=<0.
han(N,A,B,C) :- N>0,
        N1 is N - 1,
        han(N1,A,C,B),
        han(N1,C,B,A).
